import sys
import os
import random
import math

sys.path += [os.path.abspath('..')]
sys.path += [os.path.abspath('../PCI_CODE/chapter6')]
sys.path += [os.path.abspath('../PCI_CODE/chapter7')]

# generate a random integer between 0 and 100
randf = lambda x:random.random()*x

riddle1 = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."

riddle2 = 'http://www.pythonchallenge.com/pc/def/map.html'

encode = 'abcdefghijklmnopqrstuvwxyz'
decode = 'cdefghijklmnopqrstuvwxyzab'

def run():
	puzzle2(riddle1)
	puzzle2(riddle2)
	
def puzzle2(riddle):
	cleartxt = ''
	for c in riddle:
		if (encode.find(c) >= 0):
			cleartxt = cleartxt + decode[encode.find(c)]
		else:
			cleartxt = cleartxt + c
	print cleartxt
	